import { defineStore } from "pinia";

const useFlightTaskStore = defineStore('flightTask', {
  state: () => ({
    taskNameList: [
      {
        taskNameId: 0,
        taskName: "",
        label: "全部"
      },
      {
        taskNameId: 1,
        taskName: "违法建设巡查",
        label: "违法建设巡查"
      },
      {
        taskNameId: 2,
        taskName: "海事巡查",
        label: "海事巡查"
      },
      {
        taskNameId: 3,
        taskName: "汛期地质灾害抢险排查飞行",
        label: "汛期地质灾害抢险排查飞行"
      },
      {
        taskNameId: 4,
        taskName: "训练飞行",
        label: "训练飞行"
      },
      {
        taskNameId: 5,
        taskName: "熟练飞行",
        label: "熟练飞行"
      },
      {
        taskNameId: 6,
        taskName: "转场(调机)",
        label: "转场(调机)"
      },
      {
        taskNameId: 7,
        taskName: "个人娱乐",
        label: "个人娱乐"
      },
      {
        taskNameId: 8,
        taskName: "航空表演",
        label: "航空表演"
      },
      {
        taskNameId: 9,
        taskName: "空中广告",
        label: "空中广告"
      },
      {
        taskNameId: 10,
        taskName: "空中拍照",
        label: "空中拍照"
      },
      {
        taskNameId: 11,
        taskName: "跳伞飞行服务",
        label: "跳伞飞行服务"
      },
      {
        taskNameId: 12,
        taskName: "航空摄影",
        label: "航空摄影"
      },
      {
        taskNameId: 13,
        taskName: "空中游览",
        label: "空中游览"
      },
      {
        taskNameId: 14,
        taskName: "操控员培训",
        label: "操控员培训"
      },
      {
        taskNameId: 15,
        taskName: "包机飞行",
        label: "包机飞行"
      },
      {
        taskNameId: 16,
        taskName: "石油服务",
        label: "石油服务"
      },
      {
        taskNameId: 17,
        taskName: "气象探测",
        label: "气象探测"
      },
      {
        taskNameId: 18,
        taskName: "科学实验",
        label: "科学实验"
      },
      {
        taskNameId: 19,
        taskName: "海洋监测",
        label: "海洋监测"
      },
      {
        taskNameId: 20,
        taskName: "直升机引航",
        label: "直升机引航"
      },
      {
        taskNameId: 21,
        taskName: "城市消防",
        label: "城市消防"
      },
      {
        taskNameId: 22,
        taskName: "空中巡查",
        label: "空中巡查"
      },
      {
        taskNameId: 23,
        taskName: "医疗救护",
        label: "医疗救护"
      },
      {
        taskNameId: 24,
        taskName: "电力作业",
        label: "电力作业"
      },

      {
        taskNameId: 25,
        taskName: "渔业飞行",
        label: "渔业飞行"
      },
      {
        taskNameId: 26,
        taskName: "航空喷洒",
        label: "航空喷洒"
      },

      {
        taskNameId: 27,
        taskName: "航空护林",
        label: "航空护林"
      },
      {
        taskNameId: 28,
        taskName: "航空探矿",
        label: "航空探矿"
      },
      {
        taskNameId: 29,
        taskName: "人工降水",
        label: "人工降水"
      },
      {
        taskNameId: 30,
        taskName: "路桥巡检",
        label: "路桥巡检"
      },
      {
        taskNameId: 31,
        taskName: "物流运输",
        label: "物流运输"
      },
      {
        taskNameId: 32,
        taskName: "其他",
        label: "其他"
      }
    ],
    aircraftId: "",
    flyApplyId: "",
    flyingId: "",
    activeName: "first",
    TabsVisible: false,
    droneUK: ""
  }),
  getters: {
    taskList(state) {
      return state.taskNameList.splice(1)
    }
  },
  actions: {
    openTabs(activeName, aircraftId = "", flyApplyId = "", flyingId = "", droneUK = "") {
      // console.log("activeName", activeName);
      // console.log("aircraftId", aircraftId);
      // console.log("flyApplyId", flyApplyId);
      // console.log("flyingId", flyingId);
      console.log("droneUK", droneUK);
      this.TabsVisible = true;
      this.aircraftId = aircraftId;
      this.flyApplyId = flyApplyId;
      this.flyingId = flyingId;
      this.activeName = activeName;
      this.droneUK = droneUK;
    },
    closeTabs() {
      this.TabsVisible = false
      this.aircraftId = "";
      this.flyApplyId = "";
      this.flyingId = "";
      this.droneUK = "";
      this.activeName = "first";
    }
  }
})

export default useFlightTaskStore;